home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-10-25 | 2.5 KB | 96 lines | [TEXT/MPS ] |
- {[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]}
-
- { UDemoText.inc1.p }
- { Copyright © 1986-1990 by Apple Computer, Inc. All rights reserved. }
-
- VAR
-
- gMenuOfs: INTEGER;
-
- {******************************************************************************************}
- { T D e m o T e x t A p p l i c a t i o n }
- {******************************************************************************************}
- {--------------------------------------------------------------------------------------------------}
- {$S AInit}
-
- PROCEDURE TDemoTextApplication.IDemoTextApplication;
-
- VAR
- fontName: Str255;
- aTEView: TTEView;
-
- BEGIN
-
- IF qNeedsHierarchicalMenus | gConfiguration.hasHierarchicalMenus THEN
- BEGIN
- gMBarDisplayed := kHierDisplayedMBar;
- gMenuOfs := kHierMenuOffset;
- END
- ELSE
- BEGIN
- gMBarDisplayed := kNonHierDisplayedMBar;
- gMenuOfs := 0;
- END;
-
- IApplication(kFileType);
-
- IF NOT gFinderPrinting THEN
- BEGIN
- AddResMenu(GetMHandle(mFont), 'FONT');
-
- gStaggerCount := 0;
-
- SetStyle(cBold, [bold]);
- SetStyle(cUnderline, [underline]);
- SetStyle(cItalic, [italic]);
- SetStyle(cOutline, [outline]);
- SetStyle(cShadow, [shadow]);
- SetStyle(cCondense, [condense]);
- SetStyle(cExtend, [extend]);
- END;
-
- { Instead of hard-wiring a default text style, get it from the TEView resource }
- aTEView := TTEView(DoCreateViews(NIL, NIL, kViewRsrcID, gZeroVPt));
- FailNIL(aTEView);
- GetFontName(aTEView.fTextStyle.tsFont, fontName);
- WITH gDefaultSpecs, aTEView DO { Set up initial text specs }
- BEGIN
- theTextFont := fontName;
- theTextFace := fTextStyle.tsFace;
- theTextSize := fTextStyle.tsSize;
- theTextColor := fTextStyle.tsColor;
- theJustification := fJustification;
- theBackColor := gRGBWhite;
- END;
- FreeIfObject(aTEView);
- aTEView := NIL;
- END;
-
- {--------------------------------------------------------------------------------------------------}
- {$S AOpen}
-
- FUNCTION TDemoTextApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
-
- VAR
- aTEDocument: TTEDocument;
-
- BEGIN
- New(aTEDocument);
- FailNIL(aTEDocument);
- aTEDocument.ITEDocument(kFileType, kSignature, kUsesDataFork, kUsesRsrcFork, NOT kDataOpen,
- NOT kRsrcOpen); ;
- DoMakeDocument := aTEDocument;
- END;
-
- {--------------------------------------------------------------------------------------------------}
- {$IFC qDebug}
- {$S ADebug}
-
- PROCEDURE TDemoTextApplication.IdentifySoftware;
-
- BEGIN
- WriteLn('DemoText Source date: 23 April 86; Compiled: ', COMPDATE, ' @ ', COMPTIME);
- INHERITED IdentifySoftware;
- END;
- {$ENDC}
-